<%@ Page Title="Content" Language="C#" MasterPageFile="~/Posts/Posts.master" AutoEventWireup="true" CodeFile="Controls.aspx.cs" Inherits="Posts_Controls" %>
<%@ Register Src="Header.ascx" TagPrefix="uc" TagName="Header"  %>
<asp:Content ID="Content3" ContentPlaceHolderID="phMain" Runat="Server">

<script type="text/javascript">
    $(document).ready(function() {
        /*$(".btn_showAll").hide();
        $(".btn_showAll").click(function() {
            $(".tabPage .content").slideDown("slow");
            $(".btn_hideAll").toggle();
            $(".btn_showAll").toggle();
        });

        $(".btn_hideAll").click(function() {
            $(".tabPage .content").slideUp("slow");
            $(".btn_hideAll").toggle();
            $(".btn_showAll").toggle();
        });
        $(".tabPage .header").click(function() {
            $(this).siblings('.content').slideToggle("slow");
        });*/
    });
        function OpenEditor(url, width, height) {
            var oWnd = radopen(url, "RadWindow1");
            oWnd.setSize(width, height);
        }

        function OnClientClose(oWnd) {
            if (oWnd.argument) {
                //get the transferred arguments
                if (oWnd.argument.saved) {
                    __doPostBack(oWnd.argument.ajaxId, "Refresh");
                }
                else {
                }
            }
        }

    </script>
    
    <telerik:RadWindowManager ID="winManager" Modal="true" OnClientClose="OnClientClose" Width="800" Height="600" VisibleOnPageLoad="false" DestroyOnClose="true" runat="server">
    </telerik:RadWindowManager>
    
    <uc:Header id="ucHeader" runat="server" />
    
    <asp:Panel ID="Panel1" CssClass="tabPage clearfix" runat="server">
    <%--<div class="actionButtons clearfix">
        <span class="btn_showAll">Show All</span>
        <span class="btn_hideAll">Hide All</span>
    </div>--%>
    <acms:AcmsDataList ID="dlControls" runat="server" AllowPaging="False" 
            CurentPageIndex="0"
            DataSourceID="dsPostControls" EditItemIndex="-1" 
            PageBlockSize="10" PagerPosition="Bottom" PageSize="10"
            SelectedIndex="-1" 
            TotalRecords="5" UseAjax="True"
            OnItemDataBound="dlControls_ItemDataBound"
            DataKeyFields="PostId,TemplateControlId,ConcurencyId"
            >
        <NoDataTemplate>
            <div class="ImportantText">
                <p>This post uses a template that has no content controls.<br />
                Try selecting a child node of this post.</p>
                </div>
        </NoDataTemplate>
        <itemStyle CssClass="itemStyleContainer"/>
        <NoDataStyle CssClass="noDataInfo" />
        <ItemTemplate>
        <div class="header clearfix">
            <h3><%# Eval("Name") %></h3>
            <div class="actions clearfix">
                <div class="floatRight">
                    <ul>
                    <%--<li>
                        <asp:LinkButton ID="LinkButton1" CssClass="actionBtn abUpDown" ToolTip="Open Close This Sectoinear This Item." runat="server">
                            <div class="tl">
                                <div class="tr">
                                    <div class="bl">
                                        <div class="br">
                                            <span>Open / Close</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </asp:LinkButton>
                        
                        //comment out -> <asp:Label runat="server" CssClass="ShowHide-btn" ToolTip="Show / Hide This Item"/>
                    </li>--%>
                    <li>
                        <asp:LinkButton ID="btnEdit" CssClass="actionBtn abEdit" ToolTip="Edit This Item." runat="server">
                            <div class="tl">
                                <div class="tr">
                                    <div class="bl">
                                        <div class="br">
                                            <span>Edit</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </asp:LinkButton>
                        <%--<asp:LinkButton ID="btnEdit" Text="Edit" CssClass="btn16 btnEdit16"  runat="server" />--%>
                    </li>
                    <li>
                        <asp:LinkButton ID="btnClear" CssClass="actionBtn abClear" ToolTip="Clear This Item." CommandName="Clear" OnClientClick="return confirm('Are you sure?');" runat="server">
                            <div class="tl">
                                <div class="tr">
                                    <div class="bl">
                                        <div class="br">
                                            <span>Clear</span>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </asp:LinkButton>
                        <%--<asp:LinkButton ID="btnClear" Text="Clear" CssClass="btn16 btnClear16" ToolTip="Clear This Item." CommandName="Clear" OnClientClick="return confirm('Are you sure?');" runat="server" />--%>
                    </li>
                </ul>
                </div>
            </div>
            
        </div>
                 <%--   <ul class="form" style="display:none">
                        <li class="first">
                            <asp:Label ID="lblNotesLabel" Text="Notes:" AssociatedControlID="lblNotes" runat="server" />
                            <asp:Label ID="lblNotes" Text='<%#Eval("Notes") %>' runat="server" />
                        </li>
                        <li>
                            <asp:Label ID="lblControlNotesLabel" Text='<%#Eval("TypeName", "{0} Notes") %>' AssociatedControlID="lblControlNotes" runat="server" />
                            <asp:Label ID="lblControlNotes" Text='<%#Eval("ControlNotes") %>' runat="server" />
                        </li>
                    </ul> --%>
            
            
            <asp:Panel ID="content" CssClass="content" runat="server">
              <acms:AdminContentControlLoader Id="adminCC" SiteId='<%#AcmsContext.SiteId%>' SiteVersion='<%#base.SelectedVersion%>' runat="server" />
            </asp:Panel>
            
        </ItemTemplate>
     <%--   <SeperatorTemplate>
            <hr />
        </SeperatorTemplate>--%>
    </acms:AcmsDataList>
        <acms:PostControlDataSource ID="dsPostControls" runat="server" 
            EnablePaging="False" onselectdata="dsPostControls_SelectData">
        </acms:PostControlDataSource>
    </asp:Panel>
</asp:Content>

